# encoding utf-8

from pydantic_settings import BaseSettings
from typing import Dict


class Settings(BaseSettings):
    """Application settings"""
    
    # Data query API host (支持两种命名方式保持兼容性)
    data_query_host: str = "http://47.115.38.177:8000"
    
    # Default timeout (seconds) for outbound HTTP requests from service layer
    request_timeout_seconds: int = 30
    
    index_code_config: Dict[str, str] = {
        '000001': '上证指数',
        '399001': '深证成指',
        '000985': '中证全指',
        '000016': '上证50',
        '000300': '沪深300',
        '000905': '中证500',
        '000852': '中证1000',
        '932000': '中证2000',
        '000922': '中证红利',
        '000932': '中证消费',
        '399006': '创业板指',
        '000688': '科创50',
        '000012': "国债指数",
        '000832': '中证转债',
        '000933': '中证医药',
        '000934': '中证金融',
        '399997': '中证白酒',
        '000006': '地产指数',
        '000928': '中证能源',
        '931151': '光伏产业',
        '980017': '国证芯片',
        '000066': '上证商品',
        "399373": '大盘价值',
        '399372': '大盘成长',
        '399375': '中盘价值',
        '399374': '中盘成长',
        '399377': '小盘价值',
        '399376': '小盘成长',
        '399986': '中证银行'
    }

    # 港股指数配置
    hk_index_code_config: Dict[str, str] = {
        "HSI": "恒生指数",
        "HSTECH": "恒生科技指数", 
        "HSCEI": "国企指数",
        "HSCCI": "红筹指数"
    }

    # 全球指数配置
    global_index_code_config: Dict[str, str] = {
        "UDI": "美元指数",
        "DJIA": "道琼斯", 
        "SPX": "标普500",
        "NDX": "纳斯达克",
        "FTSE": "英国富时100",
        "GDAXI": "德国DAX30",
        "N225": "日经225"
    }

    options_underlying_symbol_config: Dict[str, str] = {
        "SSE.000852": "中证1000",
        "SSE.000300": "沪深300",
        "SSE.000016": "上证50"
    }
    
    class Config:
        env_file = ".env"


settings = Settings()
